import type { BalanceDetail } from '@/types/api'

interface FetchBalanceDetailsAPIResData {
  code: number
  msg: string
  time: string
  data: BalanceDetail[]
}

interface FetchBalanceDetailsAPIParams {
  type: string // 0 收入 1 支出
}

export function fetchBalanceDetailsAPI(params: FetchBalanceDetailsAPIParams, token: string) {
  return httpInstance.get<FetchBalanceDetailsAPIResData, FetchBalanceDetailsAPIParams>(
    '/api/driver/balanceMx',
    { params, headers: { token } },
  )
}
